﻿
namespace ATA.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.ChietKhauDbdsChuongTrinh"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ChietKhauDbdsChuongTrinhEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ChietKhauDbdsChuongTrinhId property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxChietKhauDbdsChuongTrinhId;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ChietKhauDbdsChuongTrinhId property.
		/// </summary>
		protected System.Windows.Forms.Label uxChietKhauDbdsChuongTrinhIdLabel;
		
		/// <summary>
		/// ComboBox for the ChietKhauDacBietDsid property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxChietKhauDacBietDsid;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ChietKhauDacBietDsid property.
		/// </summary>
		protected System.Windows.Forms.Label uxChietKhauDacBietDsidLabel;
		
		/// <summary>
		/// ComboBox for the ChuongTrinhId property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxChuongTrinhId;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ChuongTrinhId property.
		/// </summary>
		protected System.Windows.Forms.Label uxChuongTrinhIdLabel;
		#endregion
		
		#region Main entity
		private Entities.ChietKhauDbdsChuongTrinh _ChietKhauDbdsChuongTrinh;
		/// <summary>
		/// Gets or sets the <see cref="Entities.ChietKhauDbdsChuongTrinh"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.ChietKhauDbdsChuongTrinh"/> instance.</value>
		public Entities.ChietKhauDbdsChuongTrinh ChietKhauDbdsChuongTrinh
		{
			get {return this._ChietKhauDbdsChuongTrinh;}
			set
			{
				this._ChietKhauDbdsChuongTrinh = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxChietKhauDbdsChuongTrinhId.DataBindings.Clear();
			this.uxChietKhauDbdsChuongTrinhId.DataBindings.Add("Text", this.uxBindingSource, "ChietKhauDbdsChuongTrinhId", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxChietKhauDacBietDsid.DataBindings.Clear();
			this.uxChietKhauDacBietDsid.DataBindings.Add("SelectedValue", this.uxBindingSource, "ChietKhauDacBietDsid", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxChuongTrinhId.DataBindings.Clear();
			this.uxChuongTrinhId.DataBindings.Add("SelectedValue", this.uxBindingSource, "ChuongTrinhId", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ChietKhauDbdsChuongTrinhEditControlBase"/> class.
		/// </summary>
		public ChietKhauDbdsChuongTrinhEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_ChietKhauDbdsChuongTrinh != null) _ChietKhauDbdsChuongTrinh.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxChietKhauDbdsChuongTrinhId = new System.Windows.Forms.TextBox();
			uxChietKhauDbdsChuongTrinhIdLabel = new System.Windows.Forms.Label();
			this.uxChietKhauDacBietDsid = new System.Windows.Forms.ComboBox();
			uxChietKhauDacBietDsidLabel = new System.Windows.Forms.Label();
			this.uxChuongTrinhId = new System.Windows.Forms.ComboBox();
			uxChuongTrinhIdLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxChietKhauDbdsChuongTrinhIdLabel
			//
			this.uxChietKhauDbdsChuongTrinhIdLabel.Name = "uxChietKhauDbdsChuongTrinhIdLabel";
			this.uxChietKhauDbdsChuongTrinhIdLabel.Text = "Chiet Khau Dbds Chuong Trinh Id:";
			this.uxChietKhauDbdsChuongTrinhIdLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxChietKhauDbdsChuongTrinhIdLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxChietKhauDbdsChuongTrinhIdLabel);			
			//
			// uxChietKhauDbdsChuongTrinhId
			//
			this.uxChietKhauDbdsChuongTrinhId.Name = "uxChietKhauDbdsChuongTrinhId";
            this.uxChietKhauDbdsChuongTrinhId.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxChietKhauDbdsChuongTrinhId);
			this.uxChietKhauDbdsChuongTrinhId.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxChietKhauDbdsChuongTrinhId);
			//
			// uxChietKhauDacBietDsidLabel
			//
			this.uxChietKhauDacBietDsidLabel.Name = "uxChietKhauDacBietDsidLabel";
			this.uxChietKhauDacBietDsidLabel.Text = "Chiet Khau Dac Biet Dsid:";
			this.uxChietKhauDacBietDsidLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxChietKhauDacBietDsidLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxChietKhauDacBietDsidLabel);			
			//
			// uxChietKhauDacBietDsid
			//
			this.uxChietKhauDacBietDsid.Name = "uxChietKhauDacBietDsid";
			//this.uxTableLayoutPanel.Controls.Add(this.uxChietKhauDacBietDsid);
			this.uxChietKhauDacBietDsid.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxChietKhauDacBietDsid);
			//
			// uxChuongTrinhIdLabel
			//
			this.uxChuongTrinhIdLabel.Name = "uxChuongTrinhIdLabel";
			this.uxChuongTrinhIdLabel.Text = "Chuong Trinh Id:";
			this.uxChuongTrinhIdLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxChuongTrinhIdLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxChuongTrinhIdLabel);			
			//
			// uxChuongTrinhId
			//
			this.uxChuongTrinhId.Name = "uxChuongTrinhId";
			//this.uxTableLayoutPanel.Controls.Add(this.uxChuongTrinhId);
			this.uxChuongTrinhId.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxChuongTrinhId);
			//
			// uxChietKhauDacBietDsid
			//				
			this.uxChietKhauDacBietDsid.DisplayMember = "NhomSanPhamId";	
			this.uxChietKhauDacBietDsid.ValueMember = "ChietKhauDacBietDsid";	
			//
			// uxChuongTrinhId
			//				
			this.uxChuongTrinhId.DisplayMember = "TenChuongTrinh";	
			this.uxChuongTrinhId.ValueMember = "ChuongTrinhId";	
			// 
			// ChietKhauDbdsChuongTrinhEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ChietKhauDbdsChuongTrinhEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.ChietKhauDacBietDs> _ChietKhauDacBietDsidList;
		
		/// <summary>
		/// The ComboBox associated with the ChietKhauDacBietDsid property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.ChietKhauDacBietDs> ChietKhauDacBietDsidList
		{
			get {return _ChietKhauDacBietDsidList;}
			set 
			{
				this._ChietKhauDacBietDsidList = value;
				this.uxChietKhauDacBietDsid.DataSource = null;
				this.uxChietKhauDacBietDsid.DataSource = value;
			}
		}
		
		private bool _allowNewItemInChietKhauDacBietDsidList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the ChietKhauDacBietDsid property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInChietKhauDacBietDsidList
		{
			get { return _allowNewItemInChietKhauDacBietDsidList;}
			set
			{
				this._allowNewItemInChietKhauDacBietDsidList = value;
				this.uxChietKhauDacBietDsid.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.ChuongTrinh> _ChuongTrinhIdList;
		
		/// <summary>
		/// The ComboBox associated with the ChuongTrinhId property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.ChuongTrinh> ChuongTrinhIdList
		{
			get {return _ChuongTrinhIdList;}
			set 
			{
				this._ChuongTrinhIdList = value;
				this.uxChuongTrinhId.DataSource = null;
				this.uxChuongTrinhId.DataSource = value;
			}
		}
		
		private bool _allowNewItemInChuongTrinhIdList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the ChuongTrinhId property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInChuongTrinhIdList
		{
			get { return _allowNewItemInChuongTrinhIdList;}
			set
			{
				this._allowNewItemInChuongTrinhIdList = value;
				this.uxChuongTrinhId.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
        #region Field visibility

        /// <summary>
        /// Indicates if the controls associated with the uxChietKhauDbdsChuongTrinhId property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxChietKhauDbdsChuongTrinhIdVisible
        {
            get { return this.uxChietKhauDbdsChuongTrinhId.Visible; }
            set
            {
                this.uxChietKhauDbdsChuongTrinhIdLabel.Visible = value;
                this.uxChietKhauDbdsChuongTrinhId.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxChietKhauDbdsChuongTrinhId property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxChietKhauDbdsChuongTrinhIdEnabled
        {
            get { return this.uxChietKhauDbdsChuongTrinhId.Enabled; }
            set
            {
                this.uxChietKhauDbdsChuongTrinhId.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxChietKhauDacBietDsid property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxChietKhauDacBietDsidVisible
        {
            get { return this.uxChietKhauDacBietDsid.Visible; }
            set
            {
                this.uxChietKhauDacBietDsidLabel.Visible = value;
                this.uxChietKhauDacBietDsid.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxChietKhauDacBietDsid property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxChietKhauDacBietDsidEnabled
        {
            get { return this.uxChietKhauDacBietDsid.Enabled; }
            set
            {
                this.uxChietKhauDacBietDsid.Enabled = value;
            }
        }
        /// <summary>
        /// Indicates if the controls associated with the uxChuongTrinhId property should be visible.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Visible property for related controls.")]
        public bool uxChuongTrinhIdVisible
        {
            get { return this.uxChuongTrinhId.Visible; }
            set
            {
                this.uxChuongTrinhIdLabel.Visible = value;
                this.uxChuongTrinhId.Visible = value;
            }
        }

        /// <summary>
        /// Indicates if the controls associated with the uxChuongTrinhId property should be enabled.
        /// </summary>
        [System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Set Enabled property for related controls.")]
        public bool uxChuongTrinhIdEnabled
        {
            get { return this.uxChuongTrinhId.Enabled; }
            set
            {
                this.uxChuongTrinhId.Enabled = value;
            }
        }

        #endregion

		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
